package com.itxiuyixiu.homework.entity.dto;

import com.itxiuyixiu.homework.entity.model.Academy;
import com.itxiuyixiu.homework.entity.model.Course;
import com.itxiuyixiu.homework.entity.model.Major;
import com.itxiuyixiu.homework.entity.model.Student;
import org.springframework.web.bind.annotation.RequestParam;

import javax.persistence.*;
import javax.validation.constraints.Null;
import java.time.LocalDateTime;

/**
 * @author 黄磊
 * @date 2020/3/5
 */
public class MajorDto implements Cloneable {

    /**
     * id
     */
    private Integer id;

    /**
     * 专业名称
     */
    private String majorName;

    /**
     * 学院id
     */
    private Integer academyId;

    public static Major parseMajor(MajorDto dto , Academy academy){
        Major major = new Major();
        major.setMajorName(dto.getMajorName());
        major.setAcademy(academy);
        return major;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMajorName() {
        return majorName;
    }

    public void setMajorName(String majorName) {
        this.majorName = majorName;
    }

    public Integer getAcademyId() {
        return academyId;
    }

    public void setAcademyId(Integer academyId) {
        this.academyId = academyId;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "MajorDto{" +
                "id=" + id +
                ", majorName='" + majorName + '\'' +
                ", academyId=" + academyId +
                '}';
    }
}
